﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using JasonTools;

namespace JasonToolsDemo
{
    public partial class MainPage : PhoneApplicationPage
    {
        #region Constructor
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        #endregion

        #region Calendar

        private void CalendarPopup_Click(object sender, RoutedEventArgs e)
        {
            Calendar calendar = new Calendar(this);
            calendar.SelectedDate = DateTime.Now.AddDays(2);
            calendar.DateSelected += new Calendar.DateSelectedEventHandler(calendar_DateSelected);
            calendar.Show();
        }

        void calendar_DateSelected(object sender, DateTime e)
        {
            var date = e;
        }

        #endregion

        #region Month Slider

        private void Month_Click(object sender, RoutedEventArgs e)
        {
            MonthSlider monthSlider = new MonthSlider(this);
            monthSlider.SelectedMonth = DateTime.Now.AddMonths(-1);
            monthSlider.SelectedMonthChanged += new SelectedMonthChangedEventHandler(monthSlider_SelectedMonthChanged);
            monthSlider.Show();
        }

        void monthSlider_SelectedMonthChanged(object sender, DateTime e)
        {
            var date = e;
        }

        #endregion

        private void GoCalendarPage_Click(object sender, RoutedEventArgs e)
        {
            Uri uri = new Uri("/CalendarPage.xaml", UriKind.Relative);
            NavigationService.Navigate(uri);
        }


    }
}